<!doctype html>
<html>
	<head>
		<title>测试JavaScript与C#交互</title>

	</head>
	<body>
		<input id="kw">
		<button  onclick="getInfo()">获取年龄</button>
		<button onclick="openDevToolsWindow()">开发者工具</button>


		<table class="tbl f12 td-right ">

        <tr>
            <td>user-agent[navigator]:</td>
            <td id="navigator_userAgent"></td>
        </tr>
        <tr>
            <td>platform:</td>
            <td id="navigator_platform"></td>
        </tr>
        <tr>
            <td>vendor:</td>
            <td id="navigator_vendor"></td>
        </tr>
        <tr>
            <td>appName:</td>
            <td id="navigator_appName"></td>
        </tr>
        <tr>
            <td>product:</td>
            <td id="navigator_product"></td>
        </tr>
        <tr>
            <td>appVersion:</td>
            <td id="navigator_appVersion"></td>
        </tr>
        <tr>
            <td>cookieEnabled:</td>
            <td id="navigator_cookieEnabled"></td>
        </tr>
        <tr>
            <td>language:</td>
            <td id="navigator_language"></td>
        </tr>
        <tr>
            <td>mimeTypes:</td>
            <td id="navigator_mimeTypes"></td>
        </tr>
        <tr>
            <td>CPU核心数:</td>
            <td id="navigator_hardwareConcurrency"></td>
        </tr>
        <tr>
            <td>deviceMemory:</td>
            <td id="navigator_deviceMemory"></td>
        </tr>
        <tr>
            <td>local time:</td>
            <td id="local_time"></td>
        </tr>

        <tr>
            <td>分辨率:</td>
            <td id="screen_size"></td>
        </tr>
        <tr>
            <td>colorDepth:</td>
            <td id="screen_colorDepth"></td>
        </tr>
        <tr>
            <td>pixelRatio:</td>
            <td id="devicePixelRatio"></td>
        </tr>
        <tr>
            <td>maxTouchPoints:</td>
            <td id="maxTouchPoints"></td>
        </tr>
        <tr>
            <td>触屏支持:</td>
            <td id="touchSupport"></td>
        </tr>
        <tr>
            <td>电量信息:</td>
            <td id="batteryInfo"></td>
        </tr>


        <tr>
            <td>webgl vendor:</td>
            <td id="unmasked_vendor"></td>
        </tr>
        <tr>
            <td>webgl renderer:</td>
            <td id="unmasked_renderer"></td>
        </tr>
        <tr>
            <td>webgl图像指纹:</td>
            <td id="webgl_image_hash"></td>
        </tr>
        <tr>
            <td>canvas画布指纹:</td>
            <td id="canvas_fingerprint"></td>
        </tr>
        <tr>
            <td>音频指纹:</td>
            <td id="audio_fingerprint"></td>
        </tr>
        <tr>
            <td>canvas字体指纹：</td>
            <td id="canvas_font_fingerprint"></td>
        </tr>
        <tr>
            <td>css字体指纹：</td>
            <td id="css_font_fingerprint"></td>
        </tr>
    </table>

	</body>


	<script>
		
	  const e = ["userAgent", "platform", "vendor", "appName", "product", "appVersion", "cookieEnabled", "hardwareConcurrency", "language"];
      for (let t = 0; t < e.length; t++){
  		window.navigator[e[t]]==999;
      	document.getElementById("navigator_" + e[t]).innerHTML=window.navigator[e[t]];
      }
	async function openDevToolsWindow() {  
		await aardio.openDevToolsWindow();
	};
	async function getInfo() {  
		await aardio.ShowMessageArg("测试JavaScript与C#交互 getInfo");
	};

	(async ()=>{
		//var v = await aardio.property;
    	//var n = await aardio.methodWithParametersAndReturnValue(21,12);
		//var str = await aardio.getHostProperty("toString")()

    	//alert(str);
    })()
	
</script>
</html>
